import request from '@/utils/request'
import type { trademarkResponseData, trademark } from './type'

enum API {
  TRADEMARK_URL = '/admin/product/baseTrademark',
  DELETETRADEMARK_URL = '/admin/product/baseTrademark/remove',
  ADDTRADEMARK_URL = '/admin/product/baseTrademark/save',
  UPDATETRADEMARK_URL = '/admin/product/baseTrademark/update'
}

export const reqTradeMarkList = (page: number, limit: number) => {
  return request.get<any, trademarkResponseData>(
    `${API.TRADEMARK_URL}/${page}/${limit}`
  )
}

export const delTradeMark = (id: number) => {
  return request.delete<any, any>(`${API.DELETETRADEMARK_URL}/${id}`)
}

export const addTradeMark = (data: trademark) => {
  return request.post<any, any>(API.ADDTRADEMARK_URL, data)
}

export const updateTradeMark = (data: trademark) => {
  return request.put<any, any>(API.UPDATETRADEMARK_URL, data)
}